package com.duqc.response;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @ClassName ResultException
 * @Description
 * @Author duqc
 * @Date 2021/9/7
 **/
@Data
@EqualsAndHashCode(callSuper = false)
public class ResultException extends RuntimeException {

    private static final long serialVersionUID = 5487959695313586637L;

    private ResultEnum resultEnum;

    private String responseMessage;

    public ResultException(ResultEnum responseResultEnum) {
        super(responseResultEnum.getMessage());
        this.resultEnum = responseResultEnum;
    }

    public ResultException(String responseMessage) {
        super(responseMessage);
        this.responseMessage = responseMessage;
        this.resultEnum = null;
    }

    public ResultException(ResultEnum responseResultEnum, String responseMessage) {
        super(responseMessage);
        this.resultEnum = responseResultEnum;
        this.responseMessage = responseMessage;
    }
}
